﻿#ifndef NctiDCMParametric_H
#define NctiDCMParametric_H
#include "dcl_ncti_object.h"
#include "NctiDisplayDCMGeometry.h"
#include "NctiDisplayDCMDimSys.h"
#include "NctiDCMExExtensionData.h"
#include "NctiDCMDef.h"
namespace NCTI
{
	class NctiDCMEXVec2d;
	class DECL_NCTI_OBJECT NctiDCMParametric : public NctiDisplayDCMGeometry
	{
		NCTI_DISPLAYOBJECT_FUNCTIONS(NctiDCMParametric)
	public:
		virtual ~NctiDCMParametric();
	public:
		virtual void Init();
		virtual EnumNctiResult UpdateDisplay();
	private:
		NCTI_READ_AND_WRITE_VERSION_FUN(1)
		double m_flimit_low;
		double m_flimit_up;
		NctiDCMExExtensionData* m_f_lower_ext_data;
		NctiDCMExExtensionData* m_f_upper_ext_data;
	public:
		virtual std::string describe() const;
		virtual NctiDCMEXVec2d direction() const { return NctiDCMEXVec2d(); }
		virtual NctiDCMEXVec2d position(double i_param) { return NctiDCMEXVec2d(); }
		virtual NctiDCMEXVec2d first_der(double i_param) { return NctiDCMEXVec2d(); }
		virtual NctiDCMEXVec2d second_der(double i_param) { return NctiDCMEXVec2d(); }

		virtual ncti_DCM_g_type identify()	const override { return NCTI_DCM_PARAMETRIC; }
		virtual NctiDCMEXGType type() const override { return EX_PARAMETRIC; }
	public:
		void Set_lower_lim(const double i_lower_lim);
		void Set_upper_lim(const double i_upper_lim);
		double lower_lim()		const { return m_flimit_low; }
		double upper_lim()		const { return m_flimit_up; }
		NctiDCMExExtensionData* get_ext_data(ncti_DCM_para_ext_end i_end) const;
		void set_ext_data(ncti_DCM_para_ext_end i_end, NctiDCMExExtensionData* i_ex_data);
		bool add_extension(ncti_DCM_para_ext_end i_end,
			double i_tstart,	// parameter on the curve the extension begins
			double i_tend,		// parameter of the curve extension far end
			ncti_DCM_para_ext_type i_type = NCTI_DCM_PARA_EXT_TYPE_LINEAR,
			ncti_DCM_para_ext_start_type i_start_type = NCTI_DCM_PARA_EXT_START_TYPE_FIXED,
			ncti_DCM_para_ext_end_type i_end_type = NCTI_DCM_PARA_EXT_END_TYPE_FIXED);
		bool remove_extension(ncti_DCM_para_ext_end i_end);
	};
}
#endif